package com.r2coding.system.api;

import com.r2coding.common.util.Result;
import com.r2coding.system.entity.OpinionEntity;
import com.r2coding.system.service.OpinionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationDetails;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.Map;

/**
 * @author:98k灬
 * @since:2022/08/12 13:02
 **/
@Slf4j
@RestController
@RequestMapping("/api/opinion")
public class ApiOpinionController {
    @Autowired
    OpinionService opinionService;

    /**
     * 新增
     *
     * @param opinion 用户意见信息
     * @return 统一响应体
     */
    @PostMapping("/save")
    public Result save(@RequestBody OpinionEntity opinion) {
        opinionService.saveOpinion(opinion);
        return Result.ok();
    }
}
